package org.xteam.sled.semantic;

import java.util.List;
import java.util.Map;

import org.xteam.parser.runtime.AstList;
import org.xteam.parser.runtime.Span;
import org.xteam.sled.ast.OpName;

public class ForwardingEvaluationContext implements IEvaluationContext {

	protected IEvaluationContext context;

	public ForwardingEvaluationContext(IEvaluationContext context) {
		this.context = context;
	}
	
	@Override
	public List<OpcodeElement> explodeOpcode(AstList<OpName> opcode) {
		return context.explodeOpcode(opcode);
	}

	@Override
	public Map<String, Integer> getNamesOf(Field field) {
		return context.getNamesOf(field);
	}

	@Override
	public IDenotable lookup(String name, Span span) {
		return context.lookup(name, span);
	}

	@Override
	public InstructionConstructor lookupConstructor(String name, Span span) {
		return context.lookupConstructor(name, span);
	}

	@Override
	public IDenotable lookupGlobal(String name, Span span) {
		return context.lookupGlobal(name, span);
	}

	@Override
	public IDenotable lookupOpt(String name) {
		return context.lookupOpt(name);
	}

	@Override
	public void reportError(Span span, String msg) {
		context.reportError(span, msg);
	}

	@Override
	public Field optField(String name) {
		return context.optField(name);
	}

}
